UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6SrRwjpaaKWKAxUC/uItkmshgbFPG2VuFKa5MQcxmHQ=' 
WHERE 
  key_id = 'e8e4263cece62256f579c3c53ee969c1eed8138aa23cc8fdc2714de0e2b98c94' 
  AND (
    token = '6SrRwjpaaKWKAxUC/uItkmshgbFPG2VuFKa5MQcxmHQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016