UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RcTPNk2qDOdevSEE8CLqHuYZwXtr5ioPUlBNNxZ6mog='
WHERE
key_id = '63d8582a9ed332d64ec447b33f46837517b5011fd65497d0ad42a2f2200e7735'
AND (
token = 'RcTPNk2qDOdevSEE8CLqHuYZwXtr5ioPUlBNNxZ6mog='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)