UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '415QawraP4q8mDiq9fUCKfruCNrdFgnV8Yp6y18OdlQ=' 
WHERE 
  key_id = 'ae278ab5828308563223f28345c6e5bb9b51b3bfeadfb870a7e5038b36f18858' 
  AND (
    token = '415QawraP4q8mDiq9fUCKfruCNrdFgnV8Yp6y18OdlQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038