UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dxFllht9STDpBAI1D7G1fqwZaKZaWs4RH0DY5bKojM8='
WHERE
key_id = 'c51567840fca1cd7e2d0589e6d68ee91edc80d8b80dd64d012e4a02fb5668c39'
AND (
token = 'dxFllht9STDpBAI1D7G1fqwZaKZaWs4RH0DY5bKojM8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)