UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+htB7clucKa/aSCi8lsIDqqSQxnAcvLsUmmYDF+kmj4=' 
WHERE 
  key_id = '1fba9eae93822226d40bb013e0888382aa0f8de66d53986a1e3f3478480901f4' 
  AND (
    token = '+htB7clucKa/aSCi8lsIDqqSQxnAcvLsUmmYDF+kmj4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044