UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YHx5bnzI1yh6TZsCs+4NnyTQeskG8GGpr4AFK/R1HhE='
WHERE
key_id = '32893f20d834fcc61707e096351a0185d63419b14cfd7febb4ee5a81e795bd7f'
AND (
token = 'YHx5bnzI1yh6TZsCs+4NnyTQeskG8GGpr4AFK/R1HhE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)