UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AgmIwCZhGG9l1V6KE8KXRkBLLV3Ug3cpT1GXd1WHSZo=' 
WHERE 
  key_id = '2a5514ebdcd835a00c266a17e6dd963c2f7e183c15b18cc1eb44e5f4498e902e' 
  AND (
    token = 'AgmIwCZhGG9l1V6KE8KXRkBLLV3Ug3cpT1GXd1WHSZo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035