UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IEbA34SxyTqP1Vxk72rZ2qdbbTURCj/huYJeBk42NK0=' 
WHERE 
  key_id = '7ff00b5c4b7a9b782cdfe807b21feb952127a3f5ca604200fe98b9268df293eb' 
  AND (
    token = 'IEbA34SxyTqP1Vxk72rZ2qdbbTURCj/huYJeBk42NK0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041