UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bl1cGV9yetrm3ZmeJ/XB1XVKdvIc28spKrgLWGChrcQ=' 
WHERE 
  key_id = '49f77ae728aa424e552b71a08ec344e40d2951e870b19f8e9d06ade8d9cac1d9' 
  AND (
    token = 'bl1cGV9yetrm3ZmeJ/XB1XVKdvIc28spKrgLWGChrcQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031