UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mP/Iqoen7ut6L1NRngZaVmE9O9TZnMM/k8k13miC9do=' 
WHERE 
  key_id = '027f6ffcc26d7c558edfb9214a8a01ac8c63a302c92c364cba01bf9945dc31ca' 
  AND (
    token = 'mP/Iqoen7ut6L1NRngZaVmE9O9TZnMM/k8k13miC9do=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029