UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zZTf1OQ25u07KAP0mpoqIjPjRNtrnCeehzIbPAGY3Uc=' 
WHERE 
  key_id = '5bb404f1b9d57aa857a5bf7e5b56d7306bd133ee1964d5bcb5ea2af57078a3a2' 
  AND (
    token = 'zZTf1OQ25u07KAP0mpoqIjPjRNtrnCeehzIbPAGY3Uc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036