UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pNNwk/b7Pm8EHN+9jS0jNPdBbTEsnx+lE8tiDdGNkkQ=' 
WHERE 
  key_id = '79a2a1d27a632e95b41ccbef85655a2544ed36b29f90ba482221606b249b3af9' 
  AND (
    token = 'pNNwk/b7Pm8EHN+9jS0jNPdBbTEsnx+lE8tiDdGNkkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063