UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3DnCmsCgIWCaGsiNLjcX0mtL9CMsW+TfTUtUAT683QQ='
WHERE
key_id = 'cbe3c1be02363b7b7442469ed5ce2a727d80320ae9d523f68e5f9f74f29d9f7a'
AND (
token = '3DnCmsCgIWCaGsiNLjcX0mtL9CMsW+TfTUtUAT683QQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)