UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JStmC8UDgtUkNuHMp1qyG1z8CaY1DV8YLsiPV5lij+g='
WHERE
key_id = '4200bb03dc2ae47694ccc8a365a614e99a8067aed4b3fd16e4a29b25457b51f3'
AND (
token = 'JStmC8UDgtUkNuHMp1qyG1z8CaY1DV8YLsiPV5lij+g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)