UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oevNM/3ObJ+6ZVKuWCSw1IJVrGh24tZB4NIeYdVcxhQ=' 
WHERE 
  key_id = '3a2331d46c8bfedc084717d35a95b728e7286381fdbfb5b2421386e0bcdd057f' 
  AND (
    token = 'oevNM/3ObJ+6ZVKuWCSw1IJVrGh24tZB4NIeYdVcxhQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023