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