UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EMhv9TUwZCL/tomsxQpsw2hTDeOrPERh6Tws90B7ktQ=' 
WHERE 
  key_id = '736613d1e2fb2714b89608378621f96125c5085ee10f7544b28e08a31f22d34b' 
  AND (
    token = 'EMhv9TUwZCL/tomsxQpsw2hTDeOrPERh6Tws90B7ktQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032