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