UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LhgYQxXSqEfiM2EJ6IuidPSY9j+JNYJ0I4hCEbmMqrM=' 
WHERE 
  key_id = 'fbef3549bac70fa94e698066ac06f7c53be09863030f511491de5a8f9a4f8d36' 
  AND (
    token = 'LhgYQxXSqEfiM2EJ6IuidPSY9j+JNYJ0I4hCEbmMqrM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031