UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LU+x3GN4ta8j4nQbAfupsQbvfQeSQ3ticRTXZOiHPpI=' 
WHERE 
  key_id = '7ed72e4f64397c33bf82acc5e6e0871e95b030c7129d5d15d8a001b74d24191c' 
  AND (
    token = 'LU+x3GN4ta8j4nQbAfupsQbvfQeSQ3ticRTXZOiHPpI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031