UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VRpSP0kqelxK5iJu/pC2p7FAk+rqTJVaH3oFiNJBEGY='
WHERE
key_id = '4680d5e258717a5f5d9dd58c653596fed36592d3dedaaabb930233422abdcd0b'
AND (
token = 'VRpSP0kqelxK5iJu/pC2p7FAk+rqTJVaH3oFiNJBEGY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)