UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+lueGpoScbwQEn0f+4sop0odr7wg7j55+rAK07IZDQw=' 
WHERE 
  key_id = 'efa9b0806b2fd18dd8b1cddd7381147d41c9a03cf1791729bb97fb8b47575518' 
  AND (
    token = '+lueGpoScbwQEn0f+4sop0odr7wg7j55+rAK07IZDQw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029