UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7kMrcJY9daidN4EXc4ytWgq8yW49kGuwKre+diqtsRQ=' 
WHERE 
  key_id = '53f772a24a2feb71e94e33c211c39ad2ade6ab2f5675c33bb9735b702a19c11b' 
  AND (
    token = '7kMrcJY9daidN4EXc4ytWgq8yW49kGuwKre+diqtsRQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037