UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KqfpFFh0DD2acro0CTGfFQPKwBE6mbSEqOmsk79U+Lw='
WHERE
key_id = 'ee1a365d62d3561c7ca0925004fd623d95bb07d617acb9e75ca0083a8b5aa08c'
AND (
token = 'KqfpFFh0DD2acro0CTGfFQPKwBE6mbSEqOmsk79U+Lw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)