UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GzeDe+ucFllzNQG6mT2MNCoIFl2Kdfvbutj25kR86hQ=' 
WHERE 
  key_id = '2fb0f9d2786bb40f59cf7d6f3962ebef2223850f9fc51485c26131da0165d212' 
  AND (
    token = 'GzeDe+ucFllzNQG6mT2MNCoIFl2Kdfvbutj25kR86hQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063