UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uOYO/0UP50LwWg7y4SxENJw6kpuAYmvK0Bch5WB8aeM='
WHERE
key_id = 'fe347b3991dd8a76bd756804d72796ae5cbd4b51614f0c6c26c32d242950e3b6'
AND (
token = 'uOYO/0UP50LwWg7y4SxENJw6kpuAYmvK0Bch5WB8aeM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)