UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C4Di7lgW8IY6NL1KjBKKzb/YiwN3/pHPly1hA1vGsVI='
WHERE
key_id = '2786997f759d5466edaafd4a7e659c94e4a66bea52a11a6c6b45aced761c75de'
AND (
token = 'C4Di7lgW8IY6NL1KjBKKzb/YiwN3/pHPly1hA1vGsVI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)