UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't1StO6wGzg1KZd/beIlvOLtO3DMOdPUeLS4UvwdHHNc='
WHERE
key_id = 'f21928fcbbb57c175c5266ecab6382515072d7f91b7022ce2438ec895629c2a8'
AND (
token = 't1StO6wGzg1KZd/beIlvOLtO3DMOdPUeLS4UvwdHHNc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)