UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PU+ONotgNjjlOky3EtoScNbIfxCFDivdXVm9ZkkTUtQ='
WHERE
key_id = '311e6ce88c8838843f63d0de955f63bade68af12e61e7b315956cf4f31367560'
AND (
token = 'PU+ONotgNjjlOky3EtoScNbIfxCFDivdXVm9ZkkTUtQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)