UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QXdAD9wk8rUeWQ4hLUOM1XY0L0zLo7SoQ3996gD8JLE='
WHERE
key_id = '84f149d1816e4cd9d968a04c545950531664926951ffad4bd75bc6aa3b7e2986'
AND (
token = 'QXdAD9wk8rUeWQ4hLUOM1XY0L0zLo7SoQ3996gD8JLE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)