UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vEo6/HC7yL1R5aaQptEC4nONaA8cFtjdYtlth7zH65w='
WHERE
key_id = 'a5ed00cfcbdaa55eb28b61a56d8e653ca37d33dbc8198a517bf11fd496c1de6b'
AND (
token = 'vEo6/HC7yL1R5aaQptEC4nONaA8cFtjdYtlth7zH65w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)