UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gP/nbLUtarPEETXr15RVt8lJfrDN8gyWBrXa/Xy257U=' 
WHERE 
  key_id = '7803d3850f52cd10f9100cf6635e1b4ccf9b60f1bad2c458731c440ae9eafc7c' 
  AND (
    token = 'gP/nbLUtarPEETXr15RVt8lJfrDN8gyWBrXa/Xy257U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036