UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UpjxRBUnpuHYZJ1JkkzLxAKjBTPX0T0BnPZhWsPCE28='
WHERE
key_id = '446099f5d5d4185d0b45e9901fc9b9291781539b1406c0602992c879eb01376d'
AND (
token = 'UpjxRBUnpuHYZJ1JkkzLxAKjBTPX0T0BnPZhWsPCE28='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)